this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,n,a){"use strict";function r(){var e=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<a href="','" target="_blank" class="landing-ui-panel-alert-support-link">',"</a>\n\t\t\t"]);r=function t(){return e};return e}function i(){var e=babelHelpers.taggedTemplateLiteral(['<div class="landing-ui-panel-alert-action">',"</div>"]);i=function t(){return e};return e}function l(){var e=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<button class="ui-btn ui-btn-link" onclick="','">',"</button>\n\t\t\t"]);l=function t(){return e};return e}function s(){var e=babelHelpers.taggedTemplateLiteral(['<div class="landing-ui-panel-alert-text"></div>']);s=function t(){return e};return e}var o=function(e){babelHelpers.inherits(a,e);babelHelpers.createClass(a,null,[{key:"getInstance",value:function e(){return this.staticCache.remember("instance",function(){return new a})}}]);function a(){var e;var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,a);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(a).call(this,n));e.cache=new t.Cache.MemoryCache;e.onCloseClick=e.onCloseClick.bind(babelHelpers.assertThisInitialized(e));e.text=e.getText();e.closeButton=e.getCloseButton();e.action=e.getAction();t.Dom.addClass(e.layout,"landing-ui-panel-alert");t.Dom.append(e.text,e.layout);t.Dom.append(e.action,e.layout);t.Dom.append(e.layout,document.body);return e}babelHelpers.createClass(a,[{key:"getText",value:function e(){return this.cache.remember("text",function(){return t.Tag.render(s())})}},{key:"getCloseButton",value:function e(){var a=this;return this.cache.remember("closeButton",function(){var e=n.Loc.getMessage("LANDING_ALERT_ACTION_CLOSE");return t.Tag.render(l(),a.onCloseClick,e)})}},{key:"getAction",value:function e(){var n=this;return this.cache.remember("action",function(){return t.Tag.render(i(),n.getCloseButton())})}},{key:"show",value:function e(n,r){var i=this;var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var s=Promise.resolve(this);if(this.isShown()){s=this.hide()}return s.then(function(){void babelHelpers.get(babelHelpers.getPrototypeOf(a.prototype),"show",i).call(i,i);if(n==="error"){t.Dom.removeClass(i.layout,"landing-ui-alert");t.Dom.addClass(i.layout,"landing-ui-error")}else{t.Dom.removeClass(i.layout,"landing-ui-error");t.Dom.addClass(i.layout,"landing-ui-alert")}i.text.innerHTML="".concat(r||n," ");if(!l){t.Dom.append(i.getSupportLink(),i.text)}return i})}},{key:"getSupportLink",value:function e(){var a=this;return this.cache.remember("supportLink",function(){var e="https://helpdesk.bitrix24.com/ticket.php";switch(n.Loc.getMessage("LANGUAGE_ID")){case"ru":case"by":case"kz":e="https://helpdesk.bitrix24.ru/ticket.php";break;case"de":e="https://helpdesk.bitrix24.de/ticket.php";break;case"br":e="https://helpdesk.bitrix24.com.br/ticket.php";break;case"es":e="https://helpdesk.bitrix24.es/ticket.php";break;default:}a.supportLink=BX.create("a",{props:{className:"landing-ui-panel-alert-support-link"},html:BX.Landing.Loc.getMessage("LANDING_ALERT_ACTION_SUPPORT_LINK"),attrs:{href:e,target:"_blank"}});var i=n.Loc.getMessage("LANDING_ALERT_ACTION_SUPPORT_LINK");return t.Tag.render(r(),e,i)})}},{key:"onCloseClick",value:function e(){void this.hide()}}]);return a}(a.BasePanel);babelHelpers.defineProperty(o,"staticCache",new t.Cache.MemoryCache);e.Alert=o})(this.BX.Landing.UI.Panel=this.BX.Landing.UI.Panel||{},BX,BX.Landing,BX.Landing.UI.Panel);
//# sourceMappingURL=alert.bundle.map.js